#ifndef _MEM_CHECK_H  
#define _MEM_CHECK_H  
  
#include <stdlib.h>  
  
// instead of malloc  
#define malloc(s) dbg_malloc(s, __FILE__, __LINE__)  
  
// instead of calloc  
#define calloc(c, s) dbg_calloc(c, s, __FILE__, __LINE__)  
  
// instead of free  
#define free(p) dbg_free(p)  
  
/** 
 * allocation memory 
 */  
void *dbg_malloc(size_t elem_size, char *filename, size_t line);  
  
/** 
 * allocation and zero memory 
 */  
void *dbg_calloc(size_t count, size_t elem_size, char *filename, size_t line);  
  
/** 
 * deallocate memory 
 */  
void dbg_free(void *ptr);  
  
/** 
 * show memory leake report 
 */  
void print_memory_leak_report();  
  
#endif // _MEM_CHECK_H 
